(ns qwiz.gamecore.test)

(import java.io.File)

(defn jsp-list []
  (vec
    (filter #(.endsWith % ".jsp")
      (map #(.getPath %)
        (-> (File. "C:/coborns_tomcat/webapps/ecomweb/olgviews") file-seq)))))

(println (count (jsp-list)))
;(println (count (map #(println %) (jsp-list))))

(defn replace-in-file [file from to]
  (let [text (slurp file)]
    (if (< -1 (.indexOf text from))
      (spit file (.replaceAll text from to)))))


(println (map #(replace-in-file % "images/product/smallSizeImages/" "\\${smallImagePath}") (jsp-list)))
(println (map #(replace-in-file % "images/product/bigSizeImages/" "\\${bigImagePath}") (jsp-list)))